<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>hello webgl</title>
</head>
<body onload ="main()">
<h1>写个标题</h1>
<canvas id="canvas" width="500" height ="500"></canvas>
</body>

<script>
    function main(){
        var canvas = document.getElementById("canvas");
        var gl = canvas.getContext('webgl');
        if(!gl){
            console.log("浏览器不支持webgl");
            return;
        }

        gl.clearColor(0.0,0,0,1);
        gl.clear(gl.COLOR_BUFFER_BIT);
    }
</script>

</html>